package com.wudi.estate.bean.servicemode;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Activity {
    @TableId(type = IdType.AUTO)//数据库自增
    private long id;//活动编号
    private long cid;//小区编号
    private String title;//活动标题
    private String location;//活动地点
    private String unit;//举办单位
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginTime;//活动开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;//活动截止时间
    @TableField(fill = FieldFill.INSERT)//使活动时间自动注入系统当前时间
    private Date createTime;//活动创建时间
    private boolean state;//活动状态 1为有效 0为无效

//    public Activity(long cid, String title, String location, String unit, Date beginTime, Date endTime, /*Date createTime,*/ boolean state) {
//        this.cid = cid;
//        this.title = title;
//        this.location = location;
//        this.unit = unit;
//        this.beginTime = beginTime;
//        this.endTime = endTime;
////        this.createTime = createTime;
//        this.state = state;
//    }
}
